home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17774 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: svnews.ubinet.ubs.com!ubszh!ian.johnston@ubs.com
  2. From: ian.johnston@ubs.com (Ian Johnston (by ubsswop))
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Why don't you use garbage collection
  5. Date: 17 Apr 1996 13:06:17 GMT
  6. Organization: UBS
  7. Distribution: world
  8. Message-ID: <4l2qc9$oek@ubszh.fh.zh.ubs.com>
  9. References: <AD94A731966836BF@dialup97-6-14.swipnet.se> <1996Apr16.110526.1846@ittpub> <AD9A9E819668CB68B@dialup100-3-15.swipnet.se>
  10. NNTP-Posting-Host: nol2179.fh.zh.ubs.com
  11.  
  12. In article <AD9A9E819668CB68B@dialup100-3-15.swipnet.se>, lars.farm@nts.mh.se (Lars Farm) writes:
  13. |> In article <1996Apr16.110526.1846@ittpub>,
  14. |> wil@ittpub.nl (Wil Evers) wrote:
  15. |> 
  16. |> >OK, let's get serious about this:
  17. |> >
  18. |> >1. Don't we think C++ is complex enough as it is?
  19. |> 
  20. |> See the Detlefs/Ellis GC proposal. Seems a fairly small change in the
  21. |> language compared to what is done with templates and exceptions and rtti,
  22. |> and... A couple of keywords: gc/nogc to be used optionally with class
  23. |> declarations and optionally with operator new to select collected or non
  24. |> collected heap. Later gc/nogc overrides previous. There is a way to
  25. |> finalize, but the need for this is made much smaler. What is inside most
  26. |> copy/op=/dtors? Code to copy heap data and release data held by pointers.
  27. |> What would copy/op=/dtors look like when pointers can be shared and you
  28. |> don't have to say delete? Many of them would become redundant! The
  29. |> (current) compiler generated op= and copy would very often suffice. The
  30. |> minority of objects with non empty dtors would be deleted manually just
  31. |> like now. This makes things simpler, not harder. 
  32.  
  33. Well, most of your classes may manage memory in ctors/dtors/op =, but
  34. I have many many classes which manage other resources, not memory. In fact,
  35. the classes I have which manage memory are in the minority.
  36.  
  37. So, how does the Detlefs/Ellis, or any other GC, finalise my non-memory
  38. resources?
  39.  
  40. Ian
  41.